Skip to content

Style error when customizing styleItem#675

Merged
deepin-bot[bot] merged 2 commits intolinuxdeepin:masterfrom
18202781743:master
Aug 13, 2025
Merged

Style error when customizing styleItem#675
deepin-bot[bot] merged 2 commits intolinuxdeepin:masterfrom
18202781743:master

Conversation

@18202781743
Copy link
Contributor

@18202781743 18202781743 commented Aug 12, 2025

  • Revert "fix: prevent itemSpacing override in setBackgroundType"
  • fix: prevent background type from overriding custom item spacing

pms: BUG-327525

1. Changed DStyledItemDelegate to initialize itemSpacing with -1 as
default value
2. Added spacing() method to handle negative spacing values
3. Modified setBackgroundType to only set spacing when no custom spacing
was set (spacing < 0)
4. Updated all spacing references to use the new spacing() method

Log: Fixed issue where setting background type would override custom
item spacing values

Influence:
1. Test setting custom item spacing values before/after changing
background types
2. Verify spacing behavior with different background types
(RoundedBackground, ClipCornerBackground)
3. Check layout calculations with custom spacing values
4. Test list view rendering in both LeftToRight and TopToBottom flows

fix: 修复设置背景类型会覆盖自定义间距值的问题

1. 修改 DStyledItemDelegate 默认将 itemSpacing 初始化为 -1
2. 新增 spacing() 方法处理负间距值
3. 修改 setBackgroundType 仅在未设置自定义间距时(spacing < 0)才设置
间距
4. 更新所有间距引用使用新的 spacing() 方法

Log: 修复了设置背景类型会覆盖自定义间距值的问题

Influence:
1. 测试在更改背景类型前后设置自定义间距值
2. 验证不同背景类型(RoundedBackground, ClipCornerBackground)下的间距行为
3. 检查使用自定义间距值时的布局计算
4. 测试列表视图在 LeftToRight 和 TopToBottom 两种流式布局下的渲染效果
@18202781743 18202781743 requested review from BLumia and mhduiy August 12, 2025 07:25
deepin-ci-robot added a commit to linuxdeepin/dtk6widget that referenced this pull request Aug 12, 2025
Synchronize source files from linuxdeepin/dtkwidget.

Source-pull-request: linuxdeepin/dtkwidget#675
@github-actions
Copy link
Contributor

  • 敏感词检查失败, 检测到1个文件存在敏感词
详情
{
    "src/widgets/dstyleditemdelegate.cpp": [
        {
            "line": "  \brief 设置项 item 的集合列表 \a list, 只显示有 text 的 DViewItemActionList 集合",
            "line_number": 1536,
            "rule": "C128",
            "reason": "政治敏感词 | b231f13999"
        }
    ]
}

@deepin-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, mhduiy

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@18202781743
Copy link
Contributor Author

/forcemerge

18202781743 pushed a commit to linuxdeepin/dtk6widget that referenced this pull request Aug 13, 2025
Synchronize source files from linuxdeepin/dtkwidget.

Source-pull-request: linuxdeepin/dtkwidget#675
@deepin-bot
Copy link
Contributor

deepin-bot bot commented Aug 13, 2025

This pr force merged! (status: blocked)

@deepin-bot deepin-bot bot merged commit 0214421 into linuxdeepin:master Aug 13, 2025
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants